package com.java.loginsso.pojo;

import com.baomidou.mybatisplus.enums.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.java.base.pojo.BaseEntity;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;


/**
 * <p>
 * 用户表
 * </p>
 *
 * @author TriggerWu
 * @since 2018-09-19
 */
@TableName("tb_user")
public class User extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 用户名
     */
    @Length(max = 20,min = 6,message = "用户名的长度必须在6-20之间！")
    private String username;
    /**
     * 密码，加密存储
     */
    @Length(max = 20,min = 6,message = "密码的长度必须在6-20之间！")
    @JsonIgnore
    private String password;
    /**
     * 注册手机号
     */
    @Length(max = 20,min = 6,message = "手机号码的长度必须在11位！")
    private String phone;
    /**
     * 注册邮箱
     */
    @Email(message =  "邮箱不符合规则！")
    private String email;
    private Date created;
    private Date updated;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public Date getUpdated() {
        return updated;
    }

    public void setUpdated(Date updated) {
        this.updated = updated;
    }

}
